package com.dylan.springcloud.comsumer.service;

import com.dylan.springcloud.comsumer.model.User;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Map;

/**
 * Created by Dylan on 2018/10/12.
 */
@FeignClient(name = "ch4-5-provider", path = "/user")
@Service
public interface UserFeignService {

    @RequestMapping(value = "/add", method = RequestMethod.GET)
    String addUser(@RequestParam("id") Long id, @RequestParam("name") String name, @RequestParam("age") Integer age);

    @RequestMapping(value = "/add", method = RequestMethod.GET)
    String addUser(Map<String, Object> user);

    @RequestMapping(value = "/add", method = RequestMethod.GET)
    String addUser(User user);

    @RequestMapping(value = "/update", method = RequestMethod.POST)
    String updateUser(User user);
}
